home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Classicos / Pac Man white.swf / scripts / frame_10 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  1.6 KB  |  56 lines

  1. stop();
  2. showScores = function()
  3. {
  4.    var _l2 = 10;
  5.    while(_l2 > 0)
  6.    {
  7.       var _l3 = scoreboard_lv["name" + (page + _l2)];
  8.       var s = scoreboard_lv["score" + (page + _l2)];
  9.       var _l1 = this["line" + _l2 + "_mc"];
  10.       _l1.rank_txt.text = page + _l2 + ".";
  11.       _l1.name_txt.text = !_l3.length ? "..." : _l3.toUpperCase();
  12.       _l1.score_txt.text = !s.length ? "..." : s.addCommas();
  13.       _l1.rank_txt.textColor = _l1.name_txt.textColor = _l1.score_txt.textColor = !(game_so.data.playerName.length && _l3.toUpperCase() == game_so.data.playerName.toUpperCase()) ? 16777215 : 16777011;
  14.       _l1._visible = true;
  15.       loading_mc._visible = false;
  16.       _l2--;
  17.    }
  18. };
  19. page = 0;
  20. maxScore = 100;
  21. scoreboard_lv = new LoadVars();
  22. if(score > 0 && game_so.data.playerName.length > 0)
  23. {
  24.    scoreboard_lv.score = score;
  25.    scoreboard_lv.name = game_so.data.playerName.toLowerCase();
  26. }
  27. scoreboard_lv.game = "pacman";
  28. scoreboard_lv.sendAndLoad("pacman_score_text.php",scoreboard_lv,"POST");
  29. scoreboard_lv.onLoad = function(success)
  30. {
  31.    if(success)
  32.    {
  33.       if(Boolean(scoreboard_lv.success))
  34.       {
  35.          next_btn._visible = true;
  36.          if(scoreboard_lv.maxScore.length > 0)
  37.          {
  38.             maxScore = Number(scoreboard_lv.maxScore);
  39.          }
  40.          showScores();
  41.       }
  42.       else
  43.       {
  44.          loading_mc.errorMsg = scoreboard_lv.errorMsg.toUpperCase();
  45.          loading_mc.gotoAndStop(2);
  46.       }
  47.    }
  48.    else
  49.    {
  50.       loading_mc.errorMsg = "COULD NOT ACCESS SCORES.";
  51.       loading_mc.gotoAndStop(2);
  52.    }
  53. };
  54. score = 0;
  55. next_btn._visible = last_btn._visible = false;
  56.